[WIP] Add RP2040 support#101
Conversation
Otherwise the Debug_Log wouldn't never be called. Because the while is the last operation, this should affect any performance (maybe except if PSNEE_DEBUG_SERIAL_MONITOR is enabled)
|
Hello, I'm also interested in developing a specific version of PsNee for Pico devices, with support for PIO functions for input/output management. This will allow for much cleaner behavior at the BIOS patch level. PIO support will require a significant modification of the algorithms, making the version incompatible with the standard one. Therefore, I was thinking of creating a dedicated directory for this version. I also envisioned enabling mode configuration after compilation and injection. And the last thing I really wanted was to be able to compile everything under different operating systems, using a unified method. But for now, I need to finish debugging version 8.7 (there's not much left to do, but the devil is in the details). Once that's done, I can create the new directory with a clean codebase. In the meantime, I hope I haven't discouraged you, and I hope we can collaborate on this project. |
|
That is actually good news!!! Before doing this I searched about running PSNee on a RP2040, but the only project was from three years ago (?) and it was left away, that's why I tried to do it myself as I'm repairing a junk of PSX console (one SCPH-9001 and many PSOnes tho) and I have a bunch of RP2040-based devices from other projects. Right now I don't have the right tools for debugging, but I'll try to help as many as possible.
You could use Docker. Maybe a Linux based image with Arduino-cli and a bash script for setting the needed flags (MCU, Motherboard, BIOS patching, etc). The only issue is that it seems you cannot connect to a serial device within Docker on MacOS, but at least it should work on Linux and Windows (in theory) |
|
Hey, I’ve taken a crack at this myself - might be helpful here. Happy to assist if needed. |
|
For portability, we could consider using Arduino with the board manager https://github.com/earlephilhower/arduino-pico. I haven't tested this solution extensively yet, but apparently the implementation works reasonably well. Since you might be interested in getting your hands dirty, I'm considering putting all the BIOS patch functions in the PSNee file and keeping only three main files: PSNee, MCU, and settings. I was also thinking of renaming the branch to V9, as it's no longer very similar to V8. Please feel free to share your thoughts, because after digging around on my own, I'm starting to lose track of what's going on;) |
In another project I've used the above mentioned https://github.com/earlephilhower/arduino-pico and it works very well and is stable. I definitely support using the Arduino board manager! I found PsNeePIO recently to use some RP2040 before I had more Arudino to use. The UART stuff it advertised wasn't working when I tried it, so I disabled the UART option and then it worked as normal. With a few small edits, it could also be built on Raspberry Pi Pico rather than RP2040-Zero. I took out those RP2040 when I received ATtinyx5 in the mail, so I'm not using that setup anymore, but I think supporting arduino-pico via board manager is a great goal :) |
|
I just pushed V9 to master. With the current code structure, I think it will be much easier to do a high-quality port (I think I'll set aside the ARV architecture a bit because I'm reaching the limits of what we can get out of it, so I won't be making any major contributions in that area). I have a few questions for anyone interested: How do you envision structuring this? What repository should we use? Should I create a new one, or is someone motivated to tackle this for the next few years? ;) Also, if we create a new one, we need to find a catchy name for it; I suggest Playstation System Nee Extended Experience, P.S.N.E.E ;) |
|
Nop, Playstation System Nee Extended Experience Recursive Project |
Description
This add support for the RP2040, which also adds support to many dev-boards like the Raspberry Pi Pico (official dev board) and many many many Chinese clones. There are some of them at the same size of a ATTiny85 dev-board and extremely cheap too, but with the powerhouse of multiples Arduino Uno
Changes
To the moment, I just added the MCU defines. No main code was touched except for the main() function because I'm using the default "Arduino" bootloader for the RP2040. I mimicked the AVR functions with some from the Pico SDK. I'm not sure if there would be any issue with timing but, if there could be, then we could use PIO.
Testings
I used the WeAct studio dev-board (full size dev-board, almost the same as the official one) and the RP2040-Zero (micro size dev-board, just like a ATTiny85 dev-board). For the console, I used the SCPH-9001 with PU-23 (1-674-987-51). I also plan to use some PM-41 but I'm waiting for the disc drive replacement.
Compiling
Beside from Arduino (core), you also need to have the arduino-pico boards installed. Then, for the board, you have to select
Raspberry Pi Pico (2040)even if you're using a Chinese clone available from the list. The rest you have to leave it with the default values.If you're using Visual Studio Code, then you can use this arduino.json:
{ "sketch": "PSNee/PSNee.ino", "configuration": "flash=2097152_0,freq=200,opt=Small,os=none,profile=Disabled,rtti=Disabled,stackprotect=Disabled,exceptions=Disabled,dbgport=Disabled,dbglvl=None,usbstack=picosdk,ipbtstack=ipv4only,uploadmethod=default", "board": "rp2040:rp2040:rpipico", "output": "./.build" }Pinout
The used pins are from 4 to 11 (both included), wired as below:
Testing results
For now I've tested the boot up sequence. I managed to display the PS logo with the SCEA banner, then followed with a black screen (not sure if this was because an issue with PSNee, with my console, or with the disc itself, I'm still digging about that). Though it was a 50/50 for now, as the first boot-up it seems to skip the PSNee and just went right into the Memory Card manager (as if the lid was open), but after pressing the Reset button (the small button of the PS Fat) it went directly into the PS Logo.
I have to do further testing with another disc and check if this was an isolated error or if I have to improve the bootloader
TODO list